﻿<Application x:Class="MicroBlogClient.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:converter="clr-namespace:Rabbit.Converters;assembly=Rabbit.Converters"
             xmlns:theme="clr-namespace:Rabbit.Themes;assembly=Rabbit.Themes"   xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" 
             xmlns:controls="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls"
             Startup="Application_Startup" ShutdownMode="OnMainWindowClose"
             Exit="Application_Exit" DispatcherUnhandledException="Application_DispatcherUnhandledException"
             StartupUri="LoginWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <sys:String x:Key="AppTitle">微兔桌面微博</sys:String>
            <sys:String x:Key="ConsumerKey">AYByrZSXj5uaFKytTomy</sys:String>
            <sys:String x:Key="ConsumerSecret">kSIld=0ET$nUtRsWjUr(tl2-Q1l#C0G04Rr3cdgn</sys:String>
            <sys:String x:Key="RequestTokenUrl">http://api.t.sohu.com/oauth/request_token</sys:String>
            <sys:String x:Key="AuthorizationTokenUrl">http://api.t.sohu.com/oauth/authorize</sys:String>
            <sys:String x:Key="AccessTokenUrl">http://api.t.sohu.com/oauth/access_token</sys:String>
            <sys:String x:Key="APIBaseUrl">http://api.t.sohu.com</sys:String>
            <sys:String x:Key="AuthorWebSite">http://niuyuming.t.sohu.com</sys:String>
            <sys:String x:Key="StatusTextBoxHintText">说点什么吧...</sys:String>
            <sys:String x:Key="FeedBackAuthor">@韩现龙</sys:String>
            <sys:Int64 x:Key="AuthorId">24311958</sys:Int64>
            <sys:String x:Key="UserBlogPrefix">http://t.sohu.com/u/</sys:String>
            <sys:String x:Key="StatusPrefix">http://t.sohu.com/m/</sys:String>
            <sys:String x:Key="FollowersUrlPrefix">http://t.sohu.com/follow/followed.jsp?uid=</sys:String>
            <sys:String x:Key="FollowingUrlPrefix">http://t.sohu.com/follow/following.jsp?uid=</sys:String>
            <sys:String x:Key="ProfileUrlPrefix">http://t.sohu.com/profile</sys:String>
            
            
            <sys:Int32 x:Key="MaxStatusLength">140</sys:Int32>
            <sys:Int32 x:Key="AutoRetryCount">3</sys:Int32>

            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <converter:ContrastBooleanToVisibilityConverter x:Key="ContrastBooleanToVisibilityConverter"/>
            <converter:ImageConverter x:Key="ImageConverter"/>
            <converter:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
            <converter:DateTimeFormatConverter x:Key="DateTimeFormatConverter"/>
            <converter:MinusConverter x:Key="MinusConverter"/>
            <converter:GreaterThanConverter x:Key="GreaterThanConverter"/>
            <converter:LessThanOrEqualConverter x:Key="LessThanOrEqualConverter"/>
            <converter:IntegerGreaterThanToVisibilityConverter x:Key="IntegerGreaterThanToVisibilityConverter"/>
            <converter:BooleanToContrastConverter x:Key="BooleanToContrastConverter"/>

            <Style x:Key="HeadPictureBorderStyle" TargetType="Border" >
                <Setter Property="CornerRadius" Value="1"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="Width" Value="48"/>
                <Setter Property="Background">
                    <Setter.Value>
                         <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#ffffff" Offset="0"/>
                            <GradientStop Color="#bdbdbd" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFBDBDBD" Offset="1"/>
                            <GradientStop Color="White"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
            </Style>
            
            <Style TargetType="Paragraph">
                <Setter Property="Margin" Value="0"/>
            </Style>
            <Style TargetType="controls:RichTextBoxEx">
                <Style.Resources>
                    <Storyboard x:Key="IncreaseHeight">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.MinHeight)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="120"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="DecreaseHeight">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.MinHeight)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="15"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </Style.Resources>
                <Setter Property="MinHeight" Value="15"/>
                <Setter Property="Margin" Value="5"/>
                <Setter Property="MaxHeight" Value="300"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="Padding" Value="8"/> 
                <Style.Triggers>
                    <Trigger Property="HasContent" Value="true"> 
                        <Trigger.EnterActions>
                            <BeginStoryboard Storyboard="{StaticResource IncreaseHeight}" />
                        </Trigger.EnterActions>
                        <Trigger.ExitActions>
                            <BeginStoryboard Storyboard="{StaticResource DecreaseHeight}" />
                        </Trigger.ExitActions>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <ControlTemplate x:Key="RichTextBoxTemplate" TargetType="{x:Type TextBoxBase}">
                <StackPanel>
                    <Border x:Name="Bd" MinHeight="{TemplateBinding MinHeight}"  Background="{TemplateBinding Background}"  CornerRadius="5">
                        <ScrollViewer x:Name="PART_ContentHost"  MaxHeight="{TemplateBinding MaxHeight}"  
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"  />
                    </Border>
                    <ed:RegularPolygon Fill="{TemplateBinding Background}" Margin="0,-1,15,0" HorizontalAlignment="Right" Height="7" InnerRadius="1"  PointCount="3" Stretch="Fill" Stroke="Black" StrokeThickness="0" Width="20" RenderTransformOrigin="0.5,0.5">
                        <ed:RegularPolygon.RenderTransform>
                            <TransformGroup>
                                <RotateTransform Angle="179"/>
                            </TransformGroup>
                        </ed:RegularPolygon.RenderTransform>
                    </ed:RegularPolygon>
                </StackPanel>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="HotKeyTextBoxStyle" TargetType="TextBox">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="ToolTipService.InitialShowDelay" Value="0"/>
                <Setter Property="ToolTip" Value="直接按键盘设置"/>
                <Style.Triggers>
                    <Trigger Property="IsFocused" Value="true">
                        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        <Setter Property="Foreground" Value="White"/>
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        <Setter Property="Foreground" Value="White"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="FocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Stroke="{x:Null}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="Expander">
                <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
            </Style>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Rabbit.Themes;component/Fresh/theme.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
